package com.reader.api.entity.comment;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.reader.core.validator.group.AddGroup;
import com.reader.core.validator.group.UpdateGroup;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
*
* @@description 
* @author        jiahaikun
* @date          2018-11-09
*/
@TableName("reader_comment_praise")
public class ReaderCommentPraise extends Model<ReaderCommentPraise> {

private static final long serialVersionUID = 1L;





private Integer id;

/**
* 关联id，所有有相关评论的ID
*/

@TableField("comment_id")
@NotBlank(message="评论ID不能为空", groups = {AddGroup.class, UpdateGroup.class})
private Integer commentId;

/**
* 关联APP用户表
*/

@TableField("app_user_id")

private Integer appUserId;


@TableField("insert_dt")

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date insertDt;

/**
 * 点赞状态，1为点赞，0为取消点赞
 */
@TableField(exist = false)
@NotBlank(message="点赞状态不能为空", groups = {AddGroup.class, UpdateGroup.class})
private Integer praise;



public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public Integer getCommentId() {
return commentId;
}

public void setCommentId(Integer commentId) {
this.commentId = commentId;
}

public Integer getAppUserId() {
return appUserId;
}

public void setAppUserId(Integer appUserId) {
this.appUserId = appUserId;
}

public Date getInsertDt() {
return insertDt;
}

public void setInsertDt(Date insertDt) {
this.insertDt = insertDt;
}

@Override
protected Serializable pkVal() {
return this.id;
}

	public Integer getPraise() {
		return praise;
	}

	public void setPraise(Integer praise) {
		this.praise = praise;
	}

	@Override
public String toString() {
return "ReaderCommentPraise{" +
	", id=" + id +
	", commentId=" + commentId +
	", appUserId=" + appUserId +
	", insertDt=" + insertDt +
"}";
}
}